<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.List" %>
<%@ page import="com.Monica.pojo.Student" %>
<%@ page import="java.util.ArrayList" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86182
  Date: 2020/10/29
  Time: 10:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1" >
    <c:forEach begin="1" end="10" var="i">
        <tr>
            <td>第${i}行</td>
        </tr>
    </c:forEach>
</table>
<hr>
<%-- 2.遍历object数组--%>
<%
    request.setAttribute("arr",new String[]{"1111","2222","3333"});
%>
<c:forEach items="${requestScope.arr}" var="item">
    ${item}<br>
</c:forEach>
<hr>
<%
    Map<String,Object> map = new HashMap<String,Object>();
    map.put("ke1","value1");
    map.put("ke2","value2");
    map.put("ke3","value3");
    request.setAttribute("map",map);
%>
<c:forEach items="${requestScope.map}" var="entry">
    ${entry.value}<br>
</c:forEach>


<%
    List<Student> list = new ArrayList<Student>();
    for (int i = 0 ; i < 10 ; i++){
        list.add(new Student(i,"username"+i,"password"+i,"pass"+i,18+i,"phone"+i));
    }
    request.setAttribute("stus",list);
%>
<table>

    <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>密码</th>
        <th>年龄</th>
        <th>电话</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${requestScope.stus}" var="stu">
    <tr>
        <td>${stu.id}</td>
        <td>${stu.username}</td>
        <td>${stu.password}</td>
        <td>${stu.age}</td>
        <td>${stu.phone}</td>
        <td>删除、修改</td>
    </tr>
    </c:forEach>
</table>

</body>
</html>
